<?php
namespace app\common\controller;

use think\Controller;
use think\Db;

class ApiBase extends Controller
{
	 header("Content-type: text/html; charset=utf-8");
        header("Access-Control-Allow-Origin:*");
        header("Access-Control-Expose-Headers:*");
        header("Access-Control-Allow-Methods:*");
        header("Access-Control-Allow-Headers:*");
        header("Access-Control-Allow-Credentials:true");


        if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
            header("Access-Control-Allow-Origin: *");
            header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
            header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS,PATCH');
            exit;
        }
}